feat(web): group sessions by machine and improve group headers#383
feat(web): group sessions by machine and improve group headers#383tiann merged 3 commits intotiann:mainfrom
Conversation
via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run>
There was a problem hiding this comment.
Findings
- [Major] Selected inactive sessions can disappear from the sidebar after this split.
web/src/components/SessionList.tsx:375still auto-collapses any group without an active session. After grouping bymachineId + directory, an inactive selected session on machine A no longer stays visible just because another machine has an active session in the same repo.
Suggested fix:const isGroupCollapsed = (group: SessionGroup): boolean => { const override = collapseOverrides.get(group.key) if (override !== undefined) return override const hasSelectedSession = selectedSessionId ? group.sessions.some(session => session.id === selectedSessionId) : false return !group.hasActiveSession && !hasSelectedSession }
Summary
Review mode: initial
1 issue found in the current diff.
Testing
Not run (automation). bun is not installed in this runner, so bun run typecheck:web could not be repeated here. Suggested coverage: a SessionList render case with two same-path sessions on different machines where the selected group has no active session and should remain expanded.
HAPI Bot
Prevents the selected session from disappearing when its group auto-collapses due to the active session being in a different group. via [HAPI](https://hapi.run)
There was a problem hiding this comment.
Findings
- [Minor] The sidebar summary now counts
(machineId, directory)groups, but the copy still renders that number asprojects. One repo opened on two machines will now show up as2 projects, which misstates what the counter means. Evidenceweb/src/router.tsx:117, related copyweb/src/lib/locales/en.ts:42.
Suggested fix:const sessionGroupCount = new Set(sessions.map(s => { const path = s.metadata?.worktree?.basePath ?? s.metadata?.path ?? 'Other' const machineId = s.metadata?.machineId ?? '__unknown__' return `${machineId}::${path}` })).size {t('sessions.groupCount', { n: sessions.length, m: sessionGroupCount })}
Summary
Review mode: follow-up after new commits
1 issue found in the current diff.
Testing
Not run (automation). bun is not installed in this runner, so bun run typecheck:web could not be repeated here. Not found in repo/docs: existing tests covering machine-aware sidebar grouping or the sessions counter copy.
HAPI Bot
- Clear manual collapse override when navigating into a collapsed group - Memoize projectCount to avoid recomputing on every render - Fix projectCount to count unique directories (not machine+dir pairs) so "N projects" label remains accurate across machines - Extract shared UNKNOWN_MACHINE_ID constant to prevent drift - Replace IIFE with pre-computed variable for todoProgress via [HAPI](https://hapi.run)
There was a problem hiding this comment.
Findings
- None.
Summary
Review mode: follow-up after new commits
No actionable issues found on the current head. Residual risk: Not found in repo/docs: automated coverage for machine-aware grouping and selected-session auto-expansion in web/src/components/SessionList.tsx, or for the sidebar counter semantics in web/src/router.tsx.
Testing
Not run (automation). bun is not installed in this runner, so bun run typecheck:web could not be repeated here.
HAPI Bot
Summary
Group sessions in the web sidebar by both machine and directory instead of directory alone, and improve the group header UI to make the machine context clearer.
Changes
Why
When the same repo/path exists on multiple machines, the previous UI could merge those sessions into a single group, which made it unclear where a session was running. This change keeps those groups separate and makes machine context visible at a glance.
Validation